<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%> 
<%@ page import="java.text.*"%> 

<% 
String datetime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime()); //获取系统时间
request.setAttribute("date", datetime);
%>    
<html>
<head>
    <%@include file="/common/heard.jsp"%>
    <title>信息发布管理</title>
    <script type="text/javascript" charset="utf-8" src="${basePath }ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${basePath }ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="${basePath }ueditor/lang/zh-cn/zh-cn.js"></script>

    <script>
  
    	$(function(){
    		window.UEDITOR_HOME_URL = "${basePath }ueditor/";
    		var ue = UE.getEditor('editor');
    		ue.addListener('ready',function(){
    			UE.getEditor('editor').setContent('${article.content}');
    		})
    	})
    	function doSubmit(){
    		var content= UE.getEditor('editor').getContent();
    		$("#content").val(content);
    		$("#form").attr("action","${basePath }article/admin/Editarcicle.shtml");
    		$("#form").submit();
    	}
    </script>
</head>
<body class="rightBody">
<form id="form" name="form" action="" method="post" enctype="multipart/form-data">
    <div class="p_d_1">
        <div class="p_d_1_1">
            <div class="content_info">
    <div class="c_crumbs"><div><b></b><strong>文章管理</strong>&nbsp;-&nbsp;修改文章</div></div>
    <div class="tableH2">修改文章</div>
    <table id="baseInfo" width="100%" align="center" class="list" border="0" cellpadding="0" cellspacing="0"  >
        <tr>
            <td class="tdBg" width="200px">文章分类：</td>
            <td><select name="type">
            	<c:forEach var="articletype" items="${articleType }">
            		
            		<option value="${articletype.key }" <c:if test="${article.type ==articletype.key }">selected="selected"</c:if> >${articletype.value }</option>
     			</c:forEach>
                </select>
            </td>
            
        </tr>
        <tr>
        	<td class="tdBg" width="200px">图片上传</td>
        	<td>
        	    <c:if test="${article.imageUrl != null && article.imageUrl != ''}">
                    <img src="${basePath}upload/${article.imageUrl }" width="100" height="100"/>
                   
                    <input type="hidden" name="imageUrl" value="${article.imageUrl }">
                </c:if>
        		<input type="file" name="pic">
        	</td>
        	
        </tr>
        <tr>
            <td class="tdBg" width="200px">文章标题：</td>
            <td colspan="3"><input name="title" value="${article.title }" type="text" style="width:90%">
            </td>
        </tr>
        <tr>
            <td class="tdBg" width="200px">文章内容：</td>
            <td colspan="3"> 
            	 <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
            	
            	<input name="content" id="content" type="hidden"></div>
            
            </div>
            </td> 
        </tr>
        <tr>
            <td class="tdBg" width="200px">创建人：</td>
            <td>
            	邹经
            	<input type="hidden" name="create" value="邹经">
            </td>
            <td class="tdBg" width="200px">创建时间：</td>
            <td>
              
              
              <input type="text" readonly="true" name="modifyTime" value="${date}">
            </td>
        </tr>
    </table>
    <!-- 默认信息状态为 发布 -->
    <input type="hidden" name="state" value="${article.state}">
    <input type="hidden" name="id" value="${article.id }">
    <input type="hidden" name="pageNo" value="${pageNo }">
    <input type="hidden" name="serach" value="${serach }">
    <div class="tc mt20">
       <button type="button" class="btn btn-info" onclick="doSubmit()" value="提交">提交</button>
        &nbsp;&nbsp;&nbsp;&nbsp;
       <button type="button"  onclick="javascript:history.go(-1)" class="btn btn-info" >返回</button>
    </div>
    </div></div></div>
</form>
</body>
</html>